<template>
    <view class="u-content"
        ><rich-text :nodes="content" space="nbsp"></rich-text
    ></view>
</template>

<script>
import { getProtocolByCode } from "@/api/login.js";
export default {
    data() {
        return {
            content: "",
            title: {
                OX_MAN_USER_PROTOCOL: "用户协议",
                OX_MAN_PRIVACY_AGREEMENT: "隐私协议",
                BECOME_A_SALESMAN_AGREEMENT: "业务员协议",
            },
        };
    },
    onLoad(e) {
        const { code = "" } = e;
        uni.setNavigationBarTitle({
            title: this.title[code],
        });
        getProtocolByCode(code).then(async (res) => {
            if (res.code === 200) this.content = res?.data?.protocolInfo ?? "";
        });
        // 模拟网络请求
    },
    methods: {},
};
</script>

<style lang="scss">
.u-content {
    padding: 24rpx;
    font-size: 32rpx;
    color: $u-content-color;
    line-height: 1.6;
}
</style>
